package mythesis.gui.main.components;
import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.text.*;
import javafx.scene.paint.*;
import javafx.scene.input.*;

public class Notification extends CustomNode{
    public var text:String = "";
    public var toClose:Boolean = false;
    
    override public function create() : Node
    {
        return Group
        {
            opacity: bind if (toClose==true) 0.0 else 1.0
            content:
            [
            	Rectangle
            	{
            	    width  : 960
            	    height : 25
                    fill: LinearGradient {
       				    startX: 250.0, startY: 0.0, endX: 250.0, endY: 25.0
           				proportional: false
           				stops: [ Stop { offset: 0.0 color: Color.web("#FFECA2");},
                   				 Stop { offset: 1.0 color: Color.web("#FED945");} ]
                   				 }
                   	onMousePressed: function (e:MouseEvent):Void
                   	{
                   	    toClose = true;
                   	}
            	}
            	Text
            	{
            	    x: 13
            	    y: 17
            	    content: bind text
            	    font      : Font.font("Tahoma", FontWeight.REGULAR, 10)
					fill:  Color.BLACK;
            	}
				Text
            	{
            	    x: 4
            	    y: 4
            	    content: "INFORMATION"
            	    font      : Font.font("Tahoma", FontWeight.BOLD, 10)
            	    fill      : Color.BLACK
            	}
				Text
            	{
            	    x: 6
            	    y: 2
            	    content: "INFORMATION"
            	    font      : Font.font("Tahoma", FontWeight.BOLD, 10)
            	    fill      : Color.BLACK
            	}
            	Text
            	{
            	    x: 5
            	    y: 3
            	    content: "INFORMATION"
            	    font      : Font.font("Tahoma", FontWeight.BOLD, 10)
            	    fill      : Color.WHITE
            	}

            ]
        }
    }
};
